package com.huan.storage.controller;

import com.huan.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StorageController{
    @Autowired
    private StorageService productService;


    /**
     * 扣减库存
     * @return
     */
    @GetMapping("/decrease/{productId}/{count}")
    public String decrease(@PathVariable("productId")Long productId, @PathVariable("count") Integer count){
        productService.decrease(productId,count);
        return "Ok";
    }

    /**
     * 测试
     * @return
     */
    @GetMapping("/TestOpenFeign/{id}")
    public String TestOpenFeign(@PathVariable("id")String id){
        System.out.println("TestOpenFeign~~~~~");

        return "哈哈哈";
    }
}
